<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/


Route::group(['prefix' => 'admin', 'namespace' => 'Admin'], function (){//mid中间件
   Route::resource('/','LoginControllers');
   Route::resource('index','IndexControllers');
   Route::post('/','LoginControllers@login');

});
Route::group(['prefix' => '','middleware' => 'auth'], function(){


});
Route::group(['prefix' => '', 'namespace' => 'Home'], function (){
    //首页相关
    Route::get('/','IndexControllers@index');


    //登录相关
    Route::post('login','IndexControllers@login');
    Route::resource('login','LoginControllers');

    //注册相关
    Route::post('register','AuthControllers@userRegister');
    Route::post('register/auth','AuthControllers@auth');
    Route::get('register','AuthControllers@register');
    Route::post('register/captcha','AuthControllers@code');

    //商品分类
    //Route::get('goods/sku_goods','GoodsControllers@sku');
    Route::get('goods/all_class','GoodsControllers@allClass');
    Route::resource('goods','GoodsControllers');//类别控制器
    Route::resource('auth','AuthControllers');//用户认证
    Route::resource('cart','CartControllers');//购物车
    Route::resource('order','OrderControllers');//订单中心
    Route::resource('user','UserControllers');//用户中心

    //加载商品字典


    Route::get('addgoods','addControllers@add');//添加商品
    Route::post('addgoods/auth','addControllers@auth');//添加商品
    Route::post('addgoods','addControllers@goods');//添加商品
});